package com.ymatou.iapi.godmch.service;

import jdk.nashorn.internal.codegen.CompilerConstants.Call;

import org.json.JSONException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*获取新增代理商数量统计Call
*FreeMaker Template自动生成代码
*/
public class getAgentStatCall extends YmatouBaseCall{
	private static String opurl ="api/agent/getAgentStat";
	
	public getAgentStatCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	
	 public String getStatusCode1()
	{
	  return getString("status");
	}
	
	 public String getMessage()
	{
	 return getString("msg");
	}
	
	
	public int getNewTotal() throws JSONException
	{
//	    JSONObject jsonObj = new JSONObject(this.getReturnData());
//		return new JSONObject(jsonObj.getString("result")).getString("newTotal");
		
		return new JSONObject(this.getReturnData()).getJSONObject("result").getInt("newTotal");
		
	  //return new JSONObject(getString("result").toString()).getString("newTotal");
	}
}